(define (count-occurrences s slist)
    (cond
        ((null? slist) 0)
        ((symbol? (car slist))
            (if (eqv? (car slist) s)
                (+ 1 (count-occurrences s (cdr slist)))
                (+ 0 (count-occurrences s (cdr slist)))
            )
        )
        (else
            (+
                (count-occurrences s (car slist))
                (count-occurrences s (cdr slist))
            )
        )

    )
)


(display
    (count-occurrences `x `((f x) y (((x z) x))))
)


(display
    (count-occurrences `x `((f x) y (((x z) () x))))
)


(display
    (count-occurrences `w `((f x) y (((x z) x))))
)
